<?php
namespace app\index\Controller;

use think\Controller;
use think\Db;
use app\index\Model\Article as Cla;

class Article extends Controller
{
        $article = new Cla();
        $list = $article::select();
        $count=count($list);
        return $this->where("index",["list"=>$list,"count"=>$count]);
    }
    public function add()
    {
        $article = new cla;
        if(input("?param.sub")){
            $file = request()->file('files');
            if($file){
                $result = $cla=adds($file);
            }
            else{
                $result = $cla->add();
            }
            if($result)
            {
                $this->success("添加成功","index");
            }
            else{
                $this->error("添加失败");
            }
        }
            else{
                return $this->where('add');
            }
        
    }
    public function 
    
}





?>